<?php
$title = 'Tableau de bord';
$this->headTitle($title);

///////////////// METEO /////////////////
$meteoImg = "interrogation-32.png";
if ($meteoDay) {
    if ($meteoDay['type'] == 1) {
        $meteoImg = "soleil.png";
    } elseif ($meteoDay['type'] == 2) {
        $meteoImg = "nuage-soleil.png";
    } elseif ($meteoDay['type'] == 3) {
        $meteoImg = "nuage-pluie.png";
    } elseif ($meteoDay['type'] == 4) {
        $meteoImg = "neige.png";
    }
}

///////////////// LAST DATE /////////////////
$lastDate = new \DateTime($caDay['orderDate']);
$tmestamp = $lastDate->getTimestamp();
$dNum = date('d',$tmestamp);
$mText = $tabMonthText[date('n',$tmestamp)];
$yText = date('Y',$tmestamp);
$lastDateText = $dNum.' '.$mText.' '.$yText;

///////////////// CHIFFRE D'AFFAIRES /////////////////
$ca_ttc_mois = ($caMonth['ca_ttc']) ? $caMonth['ca_ttc'] : 0;
$ca_ht_mois = ($caMonth['ca_ht']) ? $caMonth['ca_ht'] : 0;
$ca_ttc_jour = ($caDay['ca_ttc']) ? $caDay['ca_ttc'] : 0;
$ca_ht_jour = ($caDay['ca_ht']) ? $caDay['ca_ht'] : 0;

///////////////// TICKET MOYEN /////////////////
$tm_mois = ($tmMonth['nombre'] != 0) ? ($tmMonth['valeur'] / $tmMonth['nombre']) : 0;
$tm_jour = ($tmDay['nombre'] != 0) ? ($tmDay['valeur'] / $tmDay['nombre']) : 0;

///////////////// MEALS /////////////////
$repas_mois = ($mealMonth['repas']) ? $mealMonth['repas'] : 0;
$repas_jour = ($mealDay['repas']) ? $mealDay['repas'] : 0;

///////////////// ECARTS CAISSES /////////////////
$ec_mois = ($ecMonth['ec']) ? $ecMonth['ec'] : 0;
$ec_jour = ($ecDay['ec']) ? $ecDay['ec'] : 0;

///////////////// ANNULATIONS CAISSES /////////////////
$ac_mois = ($acMonth['ac']) ? $acMonth['ac'] : 0;
$ac_jour = ($acDay['ac']) ? $acDay['ac'] : 0;
$montant_ac_mois = ($acMonth['montant_ac']) ? $acMonth['montant_ac'] : 0;
$montant_ac_jour = ($acDay['montant_ac']) ? $acDay['montant_ac'] : 0;

///////////////// BANQUES /////////////////
$cb_mois = ($bqMonth['cb']) ? $bqMonth['cb'] : 0;
$cb_jour = ($bqDay['cb']) ? $bqDay['cb'] : 0;
$espece_mois = ($bqMonth['espece']) ? $bqMonth['espece'] : 0;
$espece_jour = ($bqDay['espece']) ? $bqDay['espece'] : 0;
$cheque_mois = ($bqMonth['cheque']) ? $bqMonth['cheque'] : 0;
$cheque_jour = ($bqDay['cheque']) ? $bqDay['cheque'] : 0;
$tr_mois = ($bqMonth['tr']) ? $bqMonth['tr'] : 0;
$tr_jour = ($bqDay['tr']) ? $bqDay['tr'] : 0;

///////////////// MAIN D'OEUVRE /////////////////
$mo_mois = ($rhdataMonth['mo']) ? $rhdataMonth['mo'] : 0;
$mo_jour = ($rhdataDay['mo']) ? $rhdataDay['mo'] : 0;

///////////////// NOMBRE HEURES /////////////////
$nbh_mois = ($rhdataMonth['nbh']) ? $rhdataMonth['nbh'] : 0;
$nbh_jour = ($rhdataDay['nbh']) ? $rhdataDay['nbh'] : 0;

///////////////// PRODUCTIVITE /////////////////
$prod_mois = ($rhdataMonth['prod']) ? $rhdataMonth['prod'] : 0;
$prod_jour = ($rhdataDay['prod']) ? $rhdataDay['prod'] : 0;

///////////////// TRANSFERT ENTRANT /////////////////
$te_mois = ($rhdataMonth['te']) ? $rhdataMonth['te'] : 0;
$te_jour = ($rhdataDay['te']) ? $rhdataDay['te'] : 0;

///////////////// TRANSFERT SORTANT /////////////////
$ts_mois = ($rhdataMonth['ts']) ? $rhdataMonth['ts'] : 0;
$ts_jour = ($rhdataDay['ts']) ? $rhdataDay['ts'] : 0;

///////////////// TRANSACTIONS ET VENTES /////////////////
$nbt_mois = ($nbTMonth['nbTransaction']) ? $nbTMonth['nbTransaction'] : 0;
$nbt_jour = ($nbTDay['nbTransaction']) ? $nbTDay['nbTransaction'] : 0;
$nba_mois = ($nbAMonth['nbArticle']) ? $nbAMonth['nbArticle'] : 0;
$nba_jour = ($nbADay['nbArticle']) ? $nbADay['nbArticle'] : 0;

///////////////// BUDGETS /////////////////
$budgets['day']['cattc'] = isset($budgets['day']['cattc'])?$budgets['day']['cattc']:0;
$budgets['day']['caht'] = isset($budgets['day']['caht'])?$budgets['day']['caht']:0;
$budgets['day']['nbt'] = isset($budgets['day']['nbt'])?$budgets['day']['nbt']:0;
$budgets['day']['tttxA'] = isset($budgets['day']['tttxA'])?$budgets['day']['tttxA']:0;
$budgets['day']['txE'] = isset($budgets['day']['txE'])?$budgets['day']['txE']:0;
$budgets['month']['cattc'] = isset($budgets['month']['cattc'])?$budgets['month']['cattc']:0;
$budgets['month']['caht'] = isset($budgets['month']['caht'])?$budgets['month']['caht']:0;
$budgets['month']['nbt'] = isset($budgets['month']['nbt'])?$budgets['month']['nbt']:0;
$budgets['month']['tttxA'] = isset($budgets['month']['tttxA'])?$budgets['month']['tttxA']:0;
$budgets['month']['txE'] = isset($budgets['month']['txE'])?$budgets['month']['txE']:0;
?>
<script type="text/javascript">
    function showScoring(el) {
        // Get foamUri
        var uri = document.location.pathname;
        var operationtestPos = uri.lastIndexOf("operationtest");
        var resteUri = uri.substring(operationtestPos,100);
        var operationtestUri = uri.replace(resteUri, "operationtest");
        if($(el).parent('div').hasClass('off')) {
            set_opacity('dashboard-content', 10);
            $(el).parent('div').removeClass('off');
            $(el).parent('div').addClass('on');            
            $.ajax({
                type: 'POST',
                url: operationtestUri+'/tableaudebord/scoring',
                dataType: "html",
                cache: false,
                success: function(contenu){ 
                    $("#dashboard-content").fadeOut('slow');
                    $("#dashboard-scoring").html(contenu)
                    $("#dashboard-scoring").fadeIn('slow');
                }
            }); 
        } else if($(el).parent('div').hasClass('on')) {
            set_opacity('dashboard-content', 100);
            $("#dashboard-scoring").fadeOut('slow');
            $("#dashboard-content").fadeIn('slow');
            $(el).parent('div').removeClass('on');
            $(el).parent('div').addClass('off');
        }
    }
    
    function set_opacity(id, opacity) {
        var el = document.getElementById(id);
        el.style["filter"] = "alpha(opacity="+opacity+")";
        el.style["-moz-opacity"] = opacity/100;
        el.style["-khtml-opacity"] = opacity/100;
        el.style["opacity"] = opacity/100;
        return true;
    }
</script>
<div class="content-head">
    <h3>Tableau de bord</h3>
</div>
<div class="content-body">
    <table class="page-content">
        <tr>
            <td class="perimetre-title"><div class="rotate"><?php echo ucwords(mb_strtolower($store, 'UTF-8')); ?></div></td>
            <td class="perimetre-content">
                <div class="pc-top">
                    <table>
                        <tr>
                            <td width="10%" class="pc-top-left"><p>Période</p></td>
                            <td width="90%" class="pc-top-right"><p><?php echo $periodText; ?></p></td>
                        </tr>
                    </table>
                </div>
                <div class="pc-head">
                    <table class="allrbq">
                        <tr>
                            <td width="10%" style="padding-left: 10px; color: red">Rubriques</td>
                            <td width="30%" style="vertical-align:top">
                                <p><label onclick="" style="color: red">
                                        <input type="checkbox" class="styled" id="ic" /> Indicateurs clefs</label></p>
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="ca" checked="checked" /> CA</label></p>
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="ie" checked="checked" /> Informations Encaissement</label></p>
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="mo" checked="checked" /> MO</label></p>
                            </td>
                            <td width="30%" style="vertical-align:top">
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="dtmo" checked="checked" /> Détails Transferts MO</label></p>
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="mba" checked="checked" /> Marge brute et Achats</label></p>
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="pro" checked="checked" /> Pertes/Repas/Offerts</label></p>
                                <p><label onclick="showRubrique(this);">
                                        <input type="checkbox" class="styled" id="ea" checked="checked" /> Ecarts et Annulations</label></p>
                            </td>
                            <td width="30%" style="vertical-align:bottom">
                                <p><label>
                                        <input type="checkbox" class="styled" id="uncheckall" onclick="uncheckAll();" /> Tout décocher</label></p>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="pc-content">                    
                    <div class="retour"><a href="<?php echo $this->url('operationtest/default') ?>"><img border="0" width="32" src="<?php echo $this->basePath() . '/img/operationtest/retour.png'; ?>" /></a></div>
                    <div class="scoring off"><a onclick="showScoring(this)">Scoring</a></div>
                    <div id="dashboard-content">
                        <table>
                            <tr>
                                <td class="synth-jour">
                                    <div class="synth-wrapper">
                                        <div>
                                            <table>
                                                <tr>
                                                    <td class="pc-content-head-title">Synthèse jour - <?php echo $lastDateText; ?></td>
                                                    <td class="pc-content-head-icons" style="width:32px;height:32px"><img class="mt" width="32" src="<?php echo $this->basePath() . '/img/operationtest/' . $meteoImg; ?>" /></td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div>
                                            <table class="synth-table">
                                                <tr>
                                                    <th width="32%"></th>
                                                    <th width="17%" class="lib-top">Valeur</th>
                                                    <th width="17%" class="lib-top">%</th>
                                                    <th width="17%" class="lib-top">Budget</th>
                                                    <th width="17%" class="lib-top">Ecart</th>
                                                </tr>                                        
                                                <tr class="rubTr ca">
                                                    <td width="32%" class="lib-left">CA TTC</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ca_ttc_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($budgets['day']['cattc'], 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($ca_ttc_jour - $budgets['day']['cattc']), 2, ',', ' '); ?></td>
                                                </tr>
                                                <tr class="rubTr ca">
                                                    <td width="32%" class="lib-left">CA HT</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ca_ht_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($budgets['day']['caht'], 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($ca_ht_jour - $budgets['day']['caht']), 2, ',', ' '); ?></td>
                                                </tr>
                                                <tr class="rubTr ie">
                                                    <td width="32%" class="lib-left">Transactions</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($nbt_jour, 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($budgets['day']['nbt'], 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($nbt_jour - $budgets['day']['nbt']), 0, ',', ' '); ?></td>
                                                </tr>
                                                <tr class="rubTr ie">
                                                    <td width="32%" class="lib-left">Ticket Moyen</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($tm_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mo">
                                                    <td width="32%" class="lib-left">Main d'oeuvre</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($mo_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mo">
                                                    <td width="32%" class="lib-left">Nombre heure MO</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($nbh_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mo">
                                                    <td width="32%" class="lib-left">Productivité</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($prod_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr dtmo">
                                                    <td width="32%" class="lib-left">Transferts entrants</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($te_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr dtmo">
                                                    <td width="32%" class="lib-left">Transferts sortants</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ts_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mba">
                                                    <td width="32%" class="lib-left">Marge brute</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mba">
                                                    <td width="32%" class="lib-left">Alimentaire</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($budgets['day']['caht']*$budgets['day']['tttxA'])/100, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mba">
                                                    <td width="32%" class="lib-left">Emballage</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($budgets['day']['caht']*$budgets['day']['txE'])/100, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr pro">
                                                    <td width="32%" class="lib-left">Pertes</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr pro">
                                                    <td width="32%" class="lib-left">Repas</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($repas_jour, 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>  
                                                <tr class="rubTr pro">
                                                    <td width="32%" class="lib-left">Offerts</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr ea">
                                                    <td width="32%" class="lib-left">Ecarts caisses</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ec_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr ea">
                                                    <td width="32%" class="lib-left">Montant annulations</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($montant_ac_jour, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr ea">
                                                    <td width="32%" class="lib-left">Nombre annulations</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ac_jour, 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </td>
                                <td class="synth-mois">
                                    <div class="synth-wrapper">
                                        <div>
                                            <table>
                                                <tr>
                                                    <td class="pc-content-head-title">Synthèse mois</td>
                                                    <td class="pc-content-head-icons"><img width="32" src="<?php echo $this->basePath() . '/img/operationtest/soleil.png'; ?>" /></td>
                                                    <td class="pc-content-head-icons value">
                                                        <?php
                                                        $nbtype1 = 0;
                                                        foreach ($meteoMonth as $metM):
                                                            if ($metM['type'] == 1):
                                                                $nbtype1 = $metM['nbMeteo'];
                                                            endif;
                                                        endforeach;
                                                        echo '<span class="mt">' . $nbtype1 . '</span>';
                                                        ?>
                                                    </td>
                                                    <td class="pc-content-head-icons"><img width="32" src="<?php echo $this->basePath() . '/img/operationtest/nuage-soleil.png'; ?>" /></td>
                                                    <td class="pc-content-head-icons value">
                                                        <?php
                                                        $nbtype2 = 0;
                                                        foreach ($meteoMonth as $metM):
                                                            if ($metM['type'] == 2):
                                                                $nbtype2 = $metM['nbMeteo'];
                                                            endif;
                                                        endforeach;
                                                        echo '<span class="mt">' . $nbtype2 . '</span>';
                                                        ?>
                                                    </td>
                                                    <td class="pc-content-head-icons"><img width="32" src="<?php echo $this->basePath() . '/img/operationtest/nuage-pluie.png'; ?>" /></td>
                                                    <td class="pc-content-head-icons value">
                                                        <?php
                                                        $nbtype3 = 0;
                                                        foreach ($meteoMonth as $metM):
                                                            if ($metM['type'] == 3):
                                                                $nbtype3 = $metM['nbMeteo'];
                                                            endif;
                                                        endforeach;
                                                        echo '<span class="mt">' . $nbtype3 . '</span>';
                                                        ?>
                                                    </td>
                                                    <td class="pc-content-head-icons"><img width="32" src="<?php echo $this->basePath() . '/img/operationtest/neige.png'; ?>" /></td>
                                                    <td class="pc-content-head-icons value">
                                                        <?php
                                                        $nbtype4 = 0;
                                                        foreach ($meteoMonth as $metM):
                                                            if ($metM['type'] == 4):
                                                                $nbtype4 = $metM['nbMeteo'];
                                                            endif;
                                                        endforeach;
                                                        echo '<span class="mt">' . $nbtype4 . '</span>';
                                                        ?>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div>
                                            <table class="synth-table">
                                                <tr>
                                                    <th width="32%"></th>
                                                    <th width="17%" class="lib-top">Valeur</th>
                                                    <th width="17%" class="lib-top">%</th>
                                                    <th width="17%" class="lib-top">Budget</th>
                                                    <th width="17%" class="lib-top">Ecart</th>
                                                </tr>                                        
                                                <tr class="rubTr ca">
                                                    <td width="32%" class="lib-left">CA TTC</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ca_ttc_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($budgets['month']['cattc'], 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($ca_ttc_mois - $budgets['month']['cattc']), 2, ',', ' '); ?></td>
                                                </tr>
                                                <tr class="rubTr ca">
                                                    <td width="32%" class="lib-left">CA HT</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ca_ht_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($budgets['month']['caht'], 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($ca_ht_mois - $budgets['month']['caht']), 2, ',', ' '); ?></td>
                                                </tr>
                                                <tr class="rubTr ie">
                                                    <td width="32%" class="lib-left">Transactions</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($nbt_mois, 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($budgets['month']['nbt'], 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($nbt_mois - $budgets['month']['nbt']), 0, ',', ' '); ?></td>
                                                </tr>
                                                <tr class="rubTr ie">
                                                    <td width="32%" class="lib-left">Ticket Moyen</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($tm_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mo">
                                                    <td width="32%" class="lib-left">Main d'oeuvre</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($mo_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mo">
                                                    <td width="32%" class="lib-left">Nombre heure MO</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($nbh_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mo">
                                                    <td width="32%" class="lib-left">Productivité</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($prod_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr dtmo">
                                                    <td width="32%" class="lib-left">Transferts entrants</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($te_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr dtmo">
                                                    <td width="32%" class="lib-left">Transferts sortants</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ts_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mba">
                                                    <td width="32%" class="lib-left">Marge brute</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mba">
                                                    <td width="32%" class="lib-left">Alimentaire</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($budgets['month']['caht']*$budgets['month']['tttxA'])/100, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr mba">
                                                    <td width="32%" class="lib-left">Emballage</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format(($budgets['month']['caht']*$budgets['month']['txE'])/100, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr pro">
                                                    <td width="32%" class="lib-left">Pertes</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr pro">
                                                    <td width="32%" class="lib-left">Repas</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($repas_mois, 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>  
                                                <tr class="rubTr pro">
                                                    <td width="32%" class="lib-left">Offerts</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr ea">
                                                    <td width="32%" class="lib-left">Ecarts caisses</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ec_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr ea">
                                                    <td width="32%" class="lib-left">Montant annulations</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($montant_ac_mois, 2, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                                <tr class="rubTr ea">
                                                    <td width="32%" class="lib-left">Nombre annulations</td>
                                                    <td width="17%" class="lib-value"><?php echo number_format($ac_mois, 0, ',', ' '); ?></td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                    <td width="17%" class="lib-value">&nbsp;</td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="dashboard-scoring" style="display: none"></div>
                </div>
            </td>
        </tr>
    </table>
</div>